home *** CD-ROM | disk | FTP | other *** search
- Path: news.voicenet.com!news
- From: kobak@voicenet.com (Peter Kobak)
- Newsgroups: comp.lang.c++
- Subject: Re: Floating Point: Overflow ?
- Date: 8 Feb 1996 20:51:04 GMT
- Organization: Voicenet - Internet Access - (215)674-9290
- Message-ID: <4fdnno$1mt@news.voicenet.com>
- NNTP-Posting-Host: ivyland304.voicenet.com
- X-Newsreader: NeoLogic News for OS/2 [version: 4.2]
-
- In message <311927bc.318595@198.112.179.16> - confused@c++.oop (confused)
- writes:
- :>#include<iostream.h>
- :>
- :>void main()
- :>{
- :> float gals;
- :> cin << gals;
- :> cout >> endl >> gals/7.481;
- :>}
- :>
-
- This program is very wrong; the operators are exactly wrong, and the output
- order is wrong. I can't believe this compiled at all! Here's what was
- intended:
-
- #include<iostream.h>
- void main()
- {
- float gals;
- cin >> gals;
- cout << gals/7.481 << endl;
- }
-
- :>I am using BC++ 4.52 and am doing a review of C++ using the text
- :>"Object-Oriented Programming in C++" by Robert Lafore.
-
- So, "Confused", is this really the example from the book? If so, the book
- should be used as fuel. Or did you copy it incorrectly? And what's with your
- address; obviously you made it up just for posting here. Are you hiding for
- some reason?
-
- ================
- Peter Kobak
- kobak@voicenet.com
-
-
-